Page({
  data: {
    array: ['很差', '一般', '满意', '非常满意','无可挑剔'],
    index: 3,
    id: '',
    ids: '',
    evaluateContent: '',
  },
  onLoad: function(option) {
    this.setData({
      id: option.id,
      ids: option.ids
    })
  },
  bindPickerChange(e) {
    this.setData({
      index: e.detail.value,
    });
  },
  evaluateContentInput(e){
    this.setData({
      evaluateContent: e.detail.value
    });
  },
  onSubmit(){
    var that = this;
    dd.showLoading({
      content: '数据提交中...',
      delay: 1000,
    });
    dd.httpRequest({
      url: 'http://www.ejzcat.com/DingApi/EquipmentRepair/Evaluate.ashx',
      method: 'POST',
      data: that.data,
      dataType: 'text',
      success: function(res) {
        dd.hideLoading();
        if (res.data != 0 ) {
          //dd.alert({ content: '提交成功' });
          dd.navigateBack({
            delta: 2
          });
        }
        else {
          dd.alert({ content: '提交失败:' + res.data });
        }      
      },
      fail: function(err) {
        dd.alert({ content: JSON.stringify(err) });
      },
      complete: function(res) {

      }
    });
  },
});

